﻿#region

using Newtonsoft.Json;

#endregion

namespace PTCN.CrossPlatform.BettingGame.Bingo.Models
{
    public class SedieBetLog
    {
        public long AccountId { get; private set; }
        public long Amount { get; private set; }
        public SedieGates Gate { get; private set; }

        [JsonIgnore]
        public int No { get; private set; }

        internal SedieBetLog(long accountId, long amount, SedieGates gate)
        {
            AccountId = accountId;
            Amount = amount;
            Gate = gate;
        }

        internal SedieBetLog(long accountId, long amount, SedieGates gate, int no)
        {
            AccountId = accountId;
            Amount = amount;
            Gate = gate;
            No = no;
        }

        internal bool UpdateAmount(long change)
        {
            long value = Amount + change;
            if (value < 0) return false;

            Amount = value;
            return true;
        }
    }
}